<%page expression_filter="h"/>

<%!
    from django.utils.translation import gettext as _
    from openedx.core.djangolib.markup import HTML, Text
%>

<%
split_test = context.get('split_test')
user_partition = split_test.get_selected_partition()
show_link = group_configuration_url is not None
%>

% if is_configured:
<div class="wrapper-xblock-message">
    <div class="xblock-message information">
        <p>
            <span class="message-text">
                ${Text(_("This content experiment uses group configuration '{group_configuration_name}'.")).format(
                    group_configuration_name=Text(HTML("<a href='{}' class='xblock-view-group-link'>{}</a>")).format(group_configuration_url, user_partition.name) if show_link else user_partition.name
                )}
            </span>
        </p>
    </div>
</div>
% endif

% if is_root:
    <div class="wrapper-groups is-active">
        <h3 class="sr">${_("Active Groups")}</h3>
        ${HTML(active_groups_preview)}
    </div>

    % if inactive_groups_preview:
        <div class="wrapper-groups is-inactive">
            <h3 class="title">${_("Inactive Groups")}</h3>
            ${HTML(inactive_groups_preview)}
        </div>
    % endif
% endif
